<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin:0;
        padding:0;
    }
    ul{
        width:600px;
        height:400px;
        background-color: aqua;
        margin:0 auto;
        overflow: hidden;
    }
    li{
        width: 400px;
        height: 100px;
        margin:0 auto;
        background-color: aquamarine;
        margin-top: 25px;
        line-height: 100px;
        text-align: center;
        list-style: none;
    }
    #box{
        width:100px;
        height:50px;
        background-color: cornflowerblue;
        position:absolute;
        top: 0;
        left: 0;
        border-radius: 25px;
        line-height: 50px;
        text-align: center;
        color: antiquewhite;
        display: none;
        pointer-events:none
        
    }
    #box::after{
        content: "";
        border: 15px solid transparent;
        border-top: 15px solid cornflowerblue ;
        width: 0;
        height: 0;
        position: absolute;
        top: 50px;
        left: 30px;
    }
</style>
<body>
    <ul>
        <li>001</li>
        <li>002</li>
        <li>003</li>
        <div id="box"></div>
    </ul>
</body>
<script>
document.querySelector("ul").onmousemove=function(evt){
    var e = evt || window.event
    var target = e.target || e.srcElement
    var divObj=document.querySelector("#box") 
        divObj.innerText=target.innerText
    if (target.nodeName=="LI"){
        divObj.style.display="block"
    }else{
        divObj.style.display="none"
    }
    
    divObj.style.left = e.clientX-divObj.offsetWidth/2+"px"
    divObj.style.top = e.clientY-divObj.offsetHeight/2+"px"
}
</script>